import 'package:base_lib/app.dart';
import 'package:base_lib/common/index.dart';
import 'package:base_lib/config.dart';
import 'package:base_lib/router/page_builder.dart';
import 'package:common_lib/component_list.dart';
import 'package:common_lib/patient_management/add_patient/add_patient_page.dart';
import 'package:common_lib/patient_management/patient_list/patient_list_page.dart';
import 'package:common_lib/repository/https.dart';

class CommonComponent extends IComponent {
  static String assetsPackageName = "common_lib";

  // 组件列表
  static String compoentListPage = "$assetsPackageName/compoentListPage";

  // 患者管理--患者列表
  static String patientManagement = "$assetsPackageName/patientListPage";

  // 患者管理--添加患者
  static String addPatientPage = "$assetsPackageName/addPatientPage";

  @override
  List<EventBuilder> gePublicEvents() {
    return [];
  }

  @override
  getComponentName() {
    return "CommonComponent";
  }

  @override
  void doComponentInitConfig() async {
    //       buildConfigField "String", "API_PATH", "\"https://doctorlogin-cs.jk.100cbc.com\""
    // //            buildConfigField "String", "LOGIN_PATH", "\"http://10.0.0.211:6108\""
    // //            buildConfigField "String", "DOCTOR_PATH","\"http://10.0.0.211:6110\""
    // //            buildConfigField "String", "RP_PATH","\"http://10.0.0.211:6111\""
    // //            buildConfigField "String", "FILE_PATH","\"http://10.0.0.211:6104\""
    CommonHttp.createHttpProxy(mBaseUrl: Config.loginBaseUrl);
  }

  @override
  List<PageBuilder> getPages() {
    return [
      PageBuilder(compoentListPage, (parameters) {
        return ComponentList();
      }),
      PageBuilder(patientManagement, (parameters) {
        return PatientListPage(parameters);
      }),
      PageBuilder(addPatientPage, (parameters) {
        return AddPatientPage(parameters);
      })
    ];
  }
}

class CommonBusName {
  static String selectedPatient = "selectedPatient_notiction";
}
